/**
 *
 */
import Util;
import OpenApi;
import OpenApiUtil;
import EndpointUtil;

extends OpenApi;


init(config: OpenApi.Config){
  super(config);
  @endpointRule = '';
  
  checkConfig(config);
  @endpoint = getEndpoint('mindlive', @regionId, @endpointRule, @network, @suffix, @endpointMap, @endpoint);
}

function getEndpoint(productId: string, regionId: string, endpointRule: string, network: string, suffix: string, endpointMap: map[string]string, endpoint: string) throws: string{
  if (!Util.empty(endpoint)) {
    return endpoint;
  }
  
  if (!Util.isUnset(endpointMap) && !Util.empty(endpointMap[regionId])) {
    return endpointMap[regionId];
  }
  return EndpointUtil.getEndpointRules(productId, regionId, endpointRule, network, suffix);
}

model LoginDeviceRequest {
  userId?: string(name='UserId'),
  userSource?: string(name='UserSource'),
}

model LoginDeviceResponseBody = {
  errorCode?: string(name='ErrorCode'),
  errorMessage?: string(name='ErrorMessage'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model LoginDeviceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: LoginDeviceResponseBody(name='body'),
}

async function loginDeviceWithOptions(request: LoginDeviceRequest, runtime: Util.RuntimeOptions): LoginDeviceResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.userId)) {
    query['UserId'] = request.userId;
  }
  if (!Util.isUnset(request.userSource)) {
    query['UserSource'] = request.userSource;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'LoginDevice',
    version = '2021-03-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function loginDevice(request: LoginDeviceRequest): LoginDeviceResponse {
  var runtime = new Util.RuntimeOptions{};
  return loginDeviceWithOptions(request, runtime);
}

model LogoutDeviceRequest {
  userId?: string(name='UserId'),
  userSource?: string(name='UserSource'),
}

model LogoutDeviceResponseBody = {
  errorCode?: string(name='ErrorCode'),
  errorMessage?: string(name='ErrorMessage'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model LogoutDeviceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: LogoutDeviceResponseBody(name='body'),
}

async function logoutDeviceWithOptions(request: LogoutDeviceRequest, runtime: Util.RuntimeOptions): LogoutDeviceResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.userId)) {
    query['UserId'] = request.userId;
  }
  if (!Util.isUnset(request.userSource)) {
    query['UserSource'] = request.userSource;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'LogoutDevice',
    version = '2021-03-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function logoutDevice(request: LogoutDeviceRequest): LogoutDeviceResponse {
  var runtime = new Util.RuntimeOptions{};
  return logoutDeviceWithOptions(request, runtime);
}

model QueryItemBackgroundsRequest {
  itemIds?: map[string]any(name='ItemIds'),
}

model QueryItemBackgroundsShrinkRequest {
  itemIdsShrink?: string(name='ItemIds'),
}

model QueryItemBackgroundsResponseBody = {
  data?: map[string]any(name='Data'),
  errorCode?: string(name='ErrorCode'),
  errorMessage?: string(name='ErrorMessage'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model QueryItemBackgroundsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: QueryItemBackgroundsResponseBody(name='body'),
}

async function queryItemBackgroundsWithOptions(tmpReq: QueryItemBackgroundsRequest, runtime: Util.RuntimeOptions): QueryItemBackgroundsResponse {
  Util.validateModel(tmpReq);
  var request = new QueryItemBackgroundsShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.itemIds)) {
    request.itemIdsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.itemIds, 'ItemIds', 'json');
  }
  var query = {};
  if (!Util.isUnset(request.itemIdsShrink)) {
    query['ItemIds'] = request.itemIdsShrink;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'QueryItemBackgrounds',
    version = '2021-03-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function queryItemBackgrounds(request: QueryItemBackgroundsRequest): QueryItemBackgroundsResponse {
  var runtime = new Util.RuntimeOptions{};
  return queryItemBackgroundsWithOptions(request, runtime);
}

model ReportCurrentBackgroundRequest {
  bgConfig?: map[string]any(name='BgConfig'),
  mode?: string(name='Mode'),
  open?: boolean(name='Open'),
  resourceUuid?: string(name='ResourceUuid'),
}

model ReportCurrentBackgroundShrinkRequest {
  bgConfigShrink?: string(name='BgConfig'),
  mode?: string(name='Mode'),
  open?: boolean(name='Open'),
  resourceUuid?: string(name='ResourceUuid'),
}

model ReportCurrentBackgroundResponseBody = {
  errorCode?: string(name='ErrorCode'),
  errorMessage?: string(name='ErrorMessage'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model ReportCurrentBackgroundResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ReportCurrentBackgroundResponseBody(name='body'),
}

async function reportCurrentBackgroundWithOptions(tmpReq: ReportCurrentBackgroundRequest, runtime: Util.RuntimeOptions): ReportCurrentBackgroundResponse {
  Util.validateModel(tmpReq);
  var request = new ReportCurrentBackgroundShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.bgConfig)) {
    request.bgConfigShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.bgConfig, 'BgConfig', 'json');
  }
  var query = {};
  if (!Util.isUnset(request.bgConfigShrink)) {
    query['BgConfig'] = request.bgConfigShrink;
  }
  if (!Util.isUnset(request.mode)) {
    query['Mode'] = request.mode;
  }
  if (!Util.isUnset(request.open)) {
    query['Open'] = request.open;
  }
  if (!Util.isUnset(request.resourceUuid)) {
    query['ResourceUuid'] = request.resourceUuid;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ReportCurrentBackground',
    version = '2021-03-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function reportCurrentBackground(request: ReportCurrentBackgroundRequest): ReportCurrentBackgroundResponse {
  var runtime = new Util.RuntimeOptions{};
  return reportCurrentBackgroundWithOptions(request, runtime);
}

model ReportDevConfigRequest {
  configs?: string(name='Configs'),
}

model ReportDevConfigResponseBody = {
  errorCode?: string(name='ErrorCode'),
  errorMessage?: string(name='ErrorMessage'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model ReportDevConfigResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ReportDevConfigResponseBody(name='body'),
}

async function reportDevConfigWithOptions(request: ReportDevConfigRequest, runtime: Util.RuntimeOptions): ReportDevConfigResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.configs)) {
    query['Configs'] = request.configs;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ReportDevConfig',
    version = '2021-03-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function reportDevConfig(request: ReportDevConfigRequest): ReportDevConfigResponse {
  var runtime = new Util.RuntimeOptions{};
  return reportDevConfigWithOptions(request, runtime);
}

model ReportLiveStateRequest {
  anchorId?: string(name='AnchorId'),
  id?: string(name='Id'),
  liveMode?: string(name='LiveMode'),
  liveState?: string(name='LiveState'),
  startTime?: long(name='StartTime'),
  type?: string(name='Type'),
}

model ReportLiveStateResponseBody = {
  errorCode?: string(name='ErrorCode'),
  errorMessage?: string(name='ErrorMessage'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model ReportLiveStateResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ReportLiveStateResponseBody(name='body'),
}

async function reportLiveStateWithOptions(request: ReportLiveStateRequest, runtime: Util.RuntimeOptions): ReportLiveStateResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.anchorId)) {
    query['AnchorId'] = request.anchorId;
  }
  if (!Util.isUnset(request.id)) {
    query['Id'] = request.id;
  }
  if (!Util.isUnset(request.liveMode)) {
    query['LiveMode'] = request.liveMode;
  }
  if (!Util.isUnset(request.liveState)) {
    query['LiveState'] = request.liveState;
  }
  if (!Util.isUnset(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  if (!Util.isUnset(request.type)) {
    query['Type'] = request.type;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ReportLiveState',
    version = '2021-03-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function reportLiveState(request: ReportLiveStateRequest): ReportLiveStateResponse {
  var runtime = new Util.RuntimeOptions{};
  return reportLiveStateWithOptions(request, runtime);
}

model ReportScreenRequest {
  ossBucketName?: string(name='OssBucketName'),
  ossObjectKey?: string(name='OssObjectKey'),
}

model ReportScreenResponseBody = {
  errorCode?: string(name='ErrorCode'),
  errorMessage?: string(name='ErrorMessage'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model ReportScreenResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ReportScreenResponseBody(name='body'),
}

async function reportScreenWithOptions(request: ReportScreenRequest, runtime: Util.RuntimeOptions): ReportScreenResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ossBucketName)) {
    query['OssBucketName'] = request.ossBucketName;
  }
  if (!Util.isUnset(request.ossObjectKey)) {
    query['OssObjectKey'] = request.ossObjectKey;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ReportScreen',
    version = '2021-03-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function reportScreen(request: ReportScreenRequest): ReportScreenResponse {
  var runtime = new Util.RuntimeOptions{};
  return reportScreenWithOptions(request, runtime);
}

model ReportUserConfigRequest {
  key?: string(name='Key'),
  value?: string(name='Value'),
}

model ReportUserConfigResponseBody = {
  errorCode?: string(name='ErrorCode'),
  errorMessage?: string(name='ErrorMessage'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model ReportUserConfigResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ReportUserConfigResponseBody(name='body'),
}

async function reportUserConfigWithOptions(request: ReportUserConfigRequest, runtime: Util.RuntimeOptions): ReportUserConfigResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.key)) {
    query['Key'] = request.key;
  }
  if (!Util.isUnset(request.value)) {
    query['Value'] = request.value;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ReportUserConfig',
    version = '2021-03-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function reportUserConfig(request: ReportUserConfigRequest): ReportUserConfigResponse {
  var runtime = new Util.RuntimeOptions{};
  return reportUserConfigWithOptions(request, runtime);
}

model RequestAuthorizationDataResponseBody = {
  data?: {
    url?: string(name='Url'),
  }(name='Data'),
  errorCode?: string(name='ErrorCode'),
  errorMessage?: string(name='ErrorMessage'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model RequestAuthorizationDataResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: RequestAuthorizationDataResponseBody(name='body'),
}

async function requestAuthorizationDataWithOptions(runtime: Util.RuntimeOptions): RequestAuthorizationDataResponse {
  var req = new OpenApi.OpenApiRequest{};
  var params = new OpenApi.Params{
    action = 'RequestAuthorizationData',
    version = '2021-03-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function requestAuthorizationData(): RequestAuthorizationDataResponse {
  var runtime = new Util.RuntimeOptions{};
  return requestAuthorizationDataWithOptions(runtime);
}

model RequestBackgroundResponseBody = {
  data?: {
    bgConfig?: map[string]any(name='BgConfig'),
    downloadUrl?: string(name='DownloadUrl'),
    fileType?: string(name='FileType'),
    mode?: string(name='Mode'),
    open?: boolean(name='Open'),
    resourceUuid?: string(name='ResourceUuid'),
    scope?: string(name='Scope'),
  }(name='Data'),
  errorCode?: string(name='ErrorCode'),
  errorMessage?: string(name='ErrorMessage'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model RequestBackgroundResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: RequestBackgroundResponseBody(name='body'),
}

async function requestBackgroundWithOptions(runtime: Util.RuntimeOptions): RequestBackgroundResponse {
  var req = new OpenApi.OpenApiRequest{};
  var params = new OpenApi.Params{
    action = 'RequestBackground',
    version = '2021-03-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function requestBackground(): RequestBackgroundResponse {
  var runtime = new Util.RuntimeOptions{};
  return requestBackgroundWithOptions(runtime);
}

model RequestBindDataRequest {
  liveSource?: string(name='LiveSource'),
}

model RequestBindDataResponseBody = {
  data?: {
    code?: string(name='Code'),
    maxKeepSeconds?: int32(name='MaxKeepSeconds'),
    shortUrl?: string(name='ShortUrl'),
    url?: string(name='Url'),
  }(name='Data'),
  errorCode?: string(name='ErrorCode'),
  errorMessage?: string(name='ErrorMessage'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model RequestBindDataResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: RequestBindDataResponseBody(name='body'),
}

async function requestBindDataWithOptions(request: RequestBindDataRequest, runtime: Util.RuntimeOptions): RequestBindDataResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.liveSource)) {
    query['LiveSource'] = request.liveSource;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'RequestBindData',
    version = '2021-03-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function requestBindData(request: RequestBindDataRequest): RequestBindDataResponse {
  var runtime = new Util.RuntimeOptions{};
  return requestBindDataWithOptions(request, runtime);
}

model RequestBindingStateResponseBody = {
  data?: {
    bindAt?: long(name='BindAt'),
    deviceId?: string(name='DeviceId'),
    userAvatar?: string(name='UserAvatar'),
    userId?: string(name='UserId'),
    userNick?: string(name='UserNick'),
    userSource?: string(name='UserSource'),
  }(name='Data'),
  errorCode?: string(name='ErrorCode'),
  errorMessage?: string(name='ErrorMessage'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model RequestBindingStateResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: RequestBindingStateResponseBody(name='body'),
}

async function requestBindingStateWithOptions(runtime: Util.RuntimeOptions): RequestBindingStateResponse {
  var req = new OpenApi.OpenApiRequest{};
  var params = new OpenApi.Params{
    action = 'RequestBindingState',
    version = '2021-03-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function requestBindingState(): RequestBindingStateResponse {
  var runtime = new Util.RuntimeOptions{};
  return requestBindingStateWithOptions(runtime);
}

model RequestDeviceInfoResponseBody = {
  data?: {
    deviceId?: string(name='DeviceId'),
    deviceName?: string(name='DeviceName'),
    deviceSn?: string(name='DeviceSn'),
    publicIp?: string(name='PublicIp'),
  }(name='Data'),
  errorCode?: string(name='ErrorCode'),
  errorMessage?: string(name='ErrorMessage'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model RequestDeviceInfoResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: RequestDeviceInfoResponseBody(name='body'),
}

async function requestDeviceInfoWithOptions(runtime: Util.RuntimeOptions): RequestDeviceInfoResponse {
  var req = new OpenApi.OpenApiRequest{};
  var params = new OpenApi.Params{
    action = 'RequestDeviceInfo',
    version = '2021-03-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function requestDeviceInfo(): RequestDeviceInfoResponse {
  var runtime = new Util.RuntimeOptions{};
  return requestDeviceInfoWithOptions(runtime);
}

model RequestIotTriadResponseBody = {
  data?: {
    deviceName?: string(name='DeviceName'),
    deviceSecret?: string(name='DeviceSecret'),
    productKey?: string(name='ProductKey'),
  }(name='Data'),
  errorCode?: string(name='ErrorCode'),
  errorMessage?: string(name='ErrorMessage'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model RequestIotTriadResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: RequestIotTriadResponseBody(name='body'),
}

async function requestIotTriadWithOptions(runtime: Util.RuntimeOptions): RequestIotTriadResponse {
  var req = new OpenApi.OpenApiRequest{};
  var params = new OpenApi.Params{
    action = 'RequestIotTriad',
    version = '2021-03-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function requestIotTriad(): RequestIotTriadResponse {
  var runtime = new Util.RuntimeOptions{};
  return requestIotTriadWithOptions(runtime);
}

model RequestLiveSellPointStateResponseBody = {
  data?: {
    display?: boolean(name='Display'),
  }(name='Data'),
  errorCode?: string(name='ErrorCode'),
  errorMessage?: string(name='ErrorMessage'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model RequestLiveSellPointStateResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: RequestLiveSellPointStateResponseBody(name='body'),
}

async function requestLiveSellPointStateWithOptions(runtime: Util.RuntimeOptions): RequestLiveSellPointStateResponse {
  var req = new OpenApi.OpenApiRequest{};
  var params = new OpenApi.Params{
    action = 'RequestLiveSellPointState',
    version = '2021-03-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function requestLiveSellPointState(): RequestLiveSellPointStateResponse {
  var runtime = new Util.RuntimeOptions{};
  return requestLiveSellPointStateWithOptions(runtime);
}

model RequestLiveTeleprompterStateResponseBody = {
  data?: {
    display?: boolean(name='Display'),
  }(name='Data'),
  errorCode?: string(name='ErrorCode'),
  errorMessage?: string(name='ErrorMessage'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model RequestLiveTeleprompterStateResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: RequestLiveTeleprompterStateResponseBody(name='body'),
}

async function requestLiveTeleprompterStateWithOptions(runtime: Util.RuntimeOptions): RequestLiveTeleprompterStateResponse {
  var req = new OpenApi.OpenApiRequest{};
  var params = new OpenApi.Params{
    action = 'RequestLiveTeleprompterState',
    version = '2021-03-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function requestLiveTeleprompterState(): RequestLiveTeleprompterStateResponse {
  var runtime = new Util.RuntimeOptions{};
  return requestLiveTeleprompterStateWithOptions(runtime);
}

model RequestOssStsRequest {
  appCode?: string(name='AppCode'),
  expireSeconds?: long(name='ExpireSeconds'),
}

model RequestOssStsResponseBody = {
  data?: {
    accessKeyId?: string(name='AccessKeyId'),
    accessKeySecret?: string(name='AccessKeySecret'),
    bucket?: string(name='Bucket'),
    endPoint?: string(name='EndPoint'),
    expire?: string(name='Expire'),
    objectKeyPrefix?: string(name='ObjectKeyPrefix'),
    securityToken?: string(name='SecurityToken'),
  }(name='Data'),
  errorCode?: string(name='ErrorCode'),
  errorMessage?: string(name='ErrorMessage'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model RequestOssStsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: RequestOssStsResponseBody(name='body'),
}

async function requestOssStsWithOptions(request: RequestOssStsRequest, runtime: Util.RuntimeOptions): RequestOssStsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.appCode)) {
    query['AppCode'] = request.appCode;
  }
  if (!Util.isUnset(request.expireSeconds)) {
    query['ExpireSeconds'] = request.expireSeconds;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'RequestOssSts',
    version = '2021-03-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function requestOssSts(request: RequestOssStsRequest): RequestOssStsResponse {
  var runtime = new Util.RuntimeOptions{};
  return requestOssStsWithOptions(request, runtime);
}

model RequestPasterResponseBody = {
  data?: [ 
    {
      configs?: map[string]any(name='Configs'),
      downloadUrl?: string(name='DownloadUrl'),
      resourceUuid?: string(name='ResourceUuid'),
    }
  ](name='Data'),
  errorCode?: string(name='ErrorCode'),
  errorMessage?: string(name='ErrorMessage'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model RequestPasterResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: RequestPasterResponseBody(name='body'),
}

async function requestPasterWithOptions(runtime: Util.RuntimeOptions): RequestPasterResponse {
  var req = new OpenApi.OpenApiRequest{};
  var params = new OpenApi.Params{
    action = 'RequestPaster',
    version = '2021-03-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function requestPaster(): RequestPasterResponse {
  var runtime = new Util.RuntimeOptions{};
  return requestPasterWithOptions(runtime);
}

model RequestResetDataRequest {
  liveSource?: string(name='LiveSource'),
}

model RequestResetDataResponseBody = {
  data?: {
    fullUrl?: string(name='FullUrl'),
    url?: string(name='Url'),
  }(name='Data'),
  errorCode?: string(name='ErrorCode'),
  errorMessage?: string(name='ErrorMessage'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model RequestResetDataResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: RequestResetDataResponseBody(name='body'),
}

async function requestResetDataWithOptions(request: RequestResetDataRequest, runtime: Util.RuntimeOptions): RequestResetDataResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.liveSource)) {
    query['LiveSource'] = request.liveSource;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'RequestResetData',
    version = '2021-03-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function requestResetData(request: RequestResetDataRequest): RequestResetDataResponse {
  var runtime = new Util.RuntimeOptions{};
  return requestResetDataWithOptions(request, runtime);
}

model RequestServiceInfoResponseBody = {
  data?: {
    serviceEffectAt?: long(name='ServiceEffectAt'),
    serviceExpireAt?: long(name='ServiceExpireAt'),
    servicePackName?: string(name='ServicePackName'),
  }(name='Data'),
  errorCode?: string(name='ErrorCode'),
  errorMessage?: string(name='ErrorMessage'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model RequestServiceInfoResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: RequestServiceInfoResponseBody(name='body'),
}

async function requestServiceInfoWithOptions(runtime: Util.RuntimeOptions): RequestServiceInfoResponse {
  var req = new OpenApi.OpenApiRequest{};
  var params = new OpenApi.Params{
    action = 'RequestServiceInfo',
    version = '2021-03-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function requestServiceInfo(): RequestServiceInfoResponse {
  var runtime = new Util.RuntimeOptions{};
  return requestServiceInfoWithOptions(runtime);
}

model RequestUserConfigRequest {
  key?: string(name='Key'),
}

model RequestUserConfigResponseBody = {
  data?: string(name='Data'),
  errorCode?: string(name='ErrorCode'),
  errorMessage?: string(name='ErrorMessage'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model RequestUserConfigResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: RequestUserConfigResponseBody(name='body'),
}

async function requestUserConfigWithOptions(request: RequestUserConfigRequest, runtime: Util.RuntimeOptions): RequestUserConfigResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.key)) {
    query['Key'] = request.key;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'RequestUserConfig',
    version = '2021-03-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function requestUserConfig(request: RequestUserConfigRequest): RequestUserConfigResponse {
  var runtime = new Util.RuntimeOptions{};
  return requestUserConfigWithOptions(request, runtime);
}

model RequestUserSellPointTemplateResponseBody = {
  data?: {
    displayConfig?: map[string]any(name='DisplayConfig'),
    templateConfig?: map[string]any(name='TemplateConfig'),
    templateUuid?: string(name='TemplateUuid'),
    url?: string(name='Url'),
  }(name='Data'),
  errorCode?: string(name='ErrorCode'),
  errorMessage?: string(name='ErrorMessage'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model RequestUserSellPointTemplateResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: RequestUserSellPointTemplateResponseBody(name='body'),
}

async function requestUserSellPointTemplateWithOptions(runtime: Util.RuntimeOptions): RequestUserSellPointTemplateResponse {
  var req = new OpenApi.OpenApiRequest{};
  var params = new OpenApi.Params{
    action = 'RequestUserSellPointTemplate',
    version = '2021-03-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function requestUserSellPointTemplate(): RequestUserSellPointTemplateResponse {
  var runtime = new Util.RuntimeOptions{};
  return requestUserSellPointTemplateWithOptions(runtime);
}

model ResetDeviceRequest {
  code?: string(name='Code'),
}

model ResetDeviceResponseBody = {
  errorCode?: string(name='ErrorCode'),
  errorMessage?: string(name='ErrorMessage'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model ResetDeviceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ResetDeviceResponseBody(name='body'),
}

async function resetDeviceWithOptions(request: ResetDeviceRequest, runtime: Util.RuntimeOptions): ResetDeviceResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.code)) {
    query['Code'] = request.code;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ResetDevice',
    version = '2021-03-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function resetDevice(request: ResetDeviceRequest): ResetDeviceResponse {
  var runtime = new Util.RuntimeOptions{};
  return resetDeviceWithOptions(request, runtime);
}

model UpdateCurrentItemRequest {
  itemId?: string(name='ItemId'),
}

model UpdateCurrentItemResponseBody = {
  data?: {
    itemBackground?: {
      downloadUrl?: string(name='DownloadUrl'),
      fileType?: string(name='FileType'),
      itemId?: string(name='ItemId'),
      resourceUuid?: string(name='ResourceUuid'),
      scope?: string(name='Scope'),
    }(name='ItemBackground'),
  }(name='Data'),
  errorCode?: string(name='ErrorCode'),
  errorMessage?: string(name='ErrorMessage'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model UpdateCurrentItemResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateCurrentItemResponseBody(name='body'),
}

async function updateCurrentItemWithOptions(request: UpdateCurrentItemRequest, runtime: Util.RuntimeOptions): UpdateCurrentItemResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.itemId)) {
    query['ItemId'] = request.itemId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'UpdateCurrentItem',
    version = '2021-03-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function updateCurrentItem(request: UpdateCurrentItemRequest): UpdateCurrentItemResponse {
  var runtime = new Util.RuntimeOptions{};
  return updateCurrentItemWithOptions(request, runtime);
}

model UpdateLiveSellPointStateRequest {
  display?: boolean(name='Display'),
}

model UpdateLiveSellPointStateResponseBody = {
  errorCode?: string(name='ErrorCode'),
  errorMessage?: string(name='ErrorMessage'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model UpdateLiveSellPointStateResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateLiveSellPointStateResponseBody(name='body'),
}

async function updateLiveSellPointStateWithOptions(request: UpdateLiveSellPointStateRequest, runtime: Util.RuntimeOptions): UpdateLiveSellPointStateResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.display)) {
    query['Display'] = request.display;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'UpdateLiveSellPointState',
    version = '2021-03-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function updateLiveSellPointState(request: UpdateLiveSellPointStateRequest): UpdateLiveSellPointStateResponse {
  var runtime = new Util.RuntimeOptions{};
  return updateLiveSellPointStateWithOptions(request, runtime);
}

model UpdateLiveTeleprompterStateRequest {
  display?: boolean(name='Display'),
}

model UpdateLiveTeleprompterStateResponseBody = {
  errorCode?: string(name='ErrorCode'),
  errorMessage?: string(name='ErrorMessage'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model UpdateLiveTeleprompterStateResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateLiveTeleprompterStateResponseBody(name='body'),
}

async function updateLiveTeleprompterStateWithOptions(request: UpdateLiveTeleprompterStateRequest, runtime: Util.RuntimeOptions): UpdateLiveTeleprompterStateResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.display)) {
    query['Display'] = request.display;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'UpdateLiveTeleprompterState',
    version = '2021-03-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function updateLiveTeleprompterState(request: UpdateLiveTeleprompterStateRequest): UpdateLiveTeleprompterStateResponse {
  var runtime = new Util.RuntimeOptions{};
  return updateLiveTeleprompterStateWithOptions(request, runtime);
}

